package com.wkq.move.module.main.frame.presenter

import com.wkq.base.frame.mosby.MvpBasePresenter
import com.wkq.move.module.main.frame.view.TvListView
import com.wkq.move.module.main.ui.fragment.TvListFragment
import com.wkq.net.model.TvListsInfo
import com.wkq.net.model.USTVShowInfo
import com.wkq.net.net.UsTvShowDataCallBack
import com.wkq.net.net.UsTvShowHtmlUtil

/**
 *
 * 作者:吴奎庆
 *
 * 时间:2020/5/22
 *
 * 用途:
 */


class TvListPresenter : MvpBasePresenter<TvListView>() {
    fun getData( index: String?) {
        UsTvShowHtmlUtil.getTvList(index, object : UsTvShowDataCallBack<TvListsInfo> {
            override fun onFail(message: String?) {
                if(view!=null){view.showMessage(message)}
            }

            override fun onSuccess(infos: TvListsInfo?) {
                ifViewAttached { view.showInfos(infos) }
            }

            override fun onLoading() {

            }
        })

    }

}